<!DOCTYPE html>
<html>
<head>
	<title>事件范例</title>
	<meta charset="utf-8">
</head>
<body style="height: 2000px;">
	<input type="text" id="inp">
	<script type="text/javascript">
		// 键盘事件
		/*var inp = document.getElementById("inp");
		inp.onkeydown = function(){
			alert("按下事件")
		}	

		inp.onkeypress = function(){
			alert("keypress事件")
		}

		document.onkeyup = function(){
			console.log("松开事件")
		}*/

		// UI事件
		// document.getElementsByTagName("body")[0].onresize = function(){
		// 	alert("窗口大小变了");
		// }
		/*document.getElementsByTagName("body")[0].onscroll = function(){
			alert("滚动了滚动条");
		}*/

	</script>

</body>
</html>